package com.askyjt.videosearch.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author yangjintao
 * @since 2020-11-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class KeyFrame extends Model<KeyFrame> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "milvus_id", type = IdType.INPUT)
    private Long milvusId;

    /**
     * 该帧对应的视频的id
     */
    private Integer videoId;

    /**
     * 该帧所在的地址
     */
    private String url;

    /**
     * 该帧在视频中的位置
     */
    private Long keyPosition;

    /**
     * 相似度
     */
    @TableField(exist = false)
    private Double distance;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableLogic
    private Boolean delFlag;

    public static final String MILVUS_ID = "milvus_Id";

    public static final String VIDEO_ID = "video_id";

    public static final String URL = "url";

    public static final String KEY_POSITION = "key_position";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String DEL_FLAG = "del_flag";

    @Override
    protected Serializable pkVal() {
        return this.milvusId;
    }

}
